<template>
    <div class="cont">
        <div class="text-2xl ml-4">小费配置</div>
        <CustomForm @submit="submit" :formList="formList"></CustomForm>
    </div>
</template>

<script setup lang="ts">
import CustomForm from '@/components/customForm/CustomForm.vue';
import { CustomFormItem, CustomFormState } from '@/components/customForm/types';

const formList = reactive<CustomFormItem[]>([
    {label: '小程序端展示的小费选项',key: 'miniProgram',type:'free',children:[],subItemType:'input'},
    {label: '平台抽成',key:'platformCommission',type: 'input'},
    {label: '代理抽成',key:'proxyCommission',type: 'input'},
    {value: '提交并保存',key:'submit',type: 'submit'}
])

const submit = (formState: CustomFormState) => {
    alert('表单结果为' + JSON.stringify(formState))
}
</script>